feat(plugins): Add prompt hook contributions#621
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Add generic plugin prompt hooks for system and user prompt context so runtime plugins can contribute bounded prompt text without owning prompt rendering. The public API now exposes platform-only system prompt context, request-scoped user prompt context, and bounded JSON session appends for deterministic prompt continuity. Core collects and validates plugin contributions, renders them under Junior-owned wrappers, and commits accepted session appends with the same durable input checkpoint as the model-visible prompt. Follow-up and steering user prompts run the same userPrompt hook path, and focused integration coverage exercises generateAssistantReply with only the Pi/model boundary faked. Co-authored-by: GPT-5 Codex <codex@openai.com>
b072c14 to
03ed059
Compare
Make userPrompt return prompt messages directly and remove the unreleased prompt session-state append path. Prompt hooks now run once for the triggering prompt of an agent run, while steering messages remain plain user input for the active run. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Run plugin user prompt hooks when an awaiting-resume session has not checkpointed the triggering prompt yet. Continue existing prompt checkpoints as before, but fall back to the prompt path when the stored record has no user message. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Expose prompt hook messages as text-only public API and remove prompt lifecycle flags from userPrompt context. Generate rendering identifiers inside core instead of requiring plugin-owned IDs. Run userPrompt only while building a fresh prompt checkpoint. Allow auth-pause session records before the prompt checkpoint so pre-prompt resumes can rebuild the prompt without storing a raw synthetic user message. Co-Authored-By: GPT-5 Codex <codex@openai.com>
Build userPrompt contexts from the exact public prompt surface instead of the broader plugin context, and let empty prompt message arrays behave as no contributions. Keep pre-prompt auth resume on the fresh prompt path and align specs with the implemented prompt hook lifecycle. Co-Authored-By: GPT-5 Codex <codex@openai.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4c73466. Configure here.
Treat empty awaiting-resume records as real turn-session resumes so pre-prompt auth pauses keep their slice metadata. When replaying an older no-checkpoint record that already stored the raw current user prompt, trim that synthetic tail before rebuilding the fresh prompt to avoid duplicating the user turn. Co-Authored-By: GPT-5 Codex <codex@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Runtime plugins can now contribute bounded system and user prompt context through generic prompt hooks instead of memory-specific core APIs. The public plugin API exposes a platform-only system prompt context, request-scoped user prompt context, bounded JSON session appends, and shared validation schemas so plugin authors see the same contract core enforces.
Core renders accepted plugin prompt text inside Junior-owned wrappers and commits matching plugin session appends in the same durable input checkpoint as the model-visible prompt. Initial, follow-up, and steering user prompts run the same userPrompt path; the focused integration test exercises generateAssistantReply with only the Pi/model boundary faked, alongside unit coverage for validation, prompt rendering, and session-log projection behavior.